//
//  CWCSearchCell.m
//  ChuanNews
//
//  Created by dllo on 16/4/27.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CWCSearchCell.h"
#import "BaseHeader.h"

@implementation CWCSearchCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.titleLabel];
        self.timeLabel = [[UILabel alloc]init];
        self.timeLabel.font = [UIFont systemFontOfSize:14];
        self.timeLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:self.timeLabel];
        
        [self jxl_setDayMode:^(UIView *view) {
            CWCSearchCell *cell = (CWCSearchCell *)view;
            cell.backgroundColor = [UIColor whiteColor];
            cell.contentView.backgroundColor = [UIColor whiteColor];
            cell.titleLabel.backgroundColor = [UIColor whiteColor];
            cell.titleLabel.textColor = [UIColor blackColor];
            cell.timeLabel.backgroundColor = [UIColor whiteColor];
            cell.timeLabel.textColor = [UIColor blackColor];
        } nightMode:^(UIView *view) {
            CWCSearchCell *cell = (CWCSearchCell *)view;
            cell.backgroundColor = [UIColor blackColor];
            cell.contentView.backgroundColor = [UIColor blackColor];
            cell.titleLabel.backgroundColor = [UIColor blackColor];
            cell.titleLabel.textColor = [UIColor whiteColor];
            cell.timeLabel.backgroundColor = [UIColor blackColor];
            cell.timeLabel.textColor = [UIColor whiteColor];        }];
    }
    return self;
}


-(void)layoutSubviews{
    [super layoutSubviews];
    self.titleLabel.frame = CGRectMake(10, 15, WIDTH - 20, 30);
    self.timeLabel.frame = CGRectMake(10, 50, 150, 20);
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
